<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">


    <ui:composition template="/WEB-INF/faces/template.xhtml">

        <!-- new title -->
        <ui:define name="title">
            <h:outputText value="Sunshine Hotel" />
        </ui:define>

        <!-- new content -->
        <ui:define name="content">

            <!-- Check login -->
            <ui:include src="/resources/include/checkLogin.xhtml" />

            <h1>
                Confirm booking
            </h1>
                        
                    <h2>
                        <b>Room Number:</b>
                        <h:outputText value="#{pickRoomControllerBean.room.roomNb}" />
                    </h2>

            <p>
                <b>From Date:</b>
                <h:outputText value="#{bookingBackingBean.fromDate}" />
                <br />
                <br />
                <b>Number of nights:</b>
                <h:outputText value="#{bookingBackingBean.noOfNights}" />
                <br />
                <br />
                <b>Has kitchen:</b>
                <h:outputText value="#{pickRoomControllerBean.room.kitchen}" />
                <br />
                <br />
                <b>Has bathroom:</b>
                <h:outputText value="#{pickRoomControllerBean.room.bathRoom}" />
                <br />
                <br />
                <b>Price:</b>
                <h:outputText value="#{(pickRoomControllerBean.room.price)*(bookingBackingBean.noOfNights)}" />
                <br />
                <br />

                <p:panel> 
                    <h:form>
                        <table border="0">
                            <tr>
                                <td>
                                    Credit card number
                                </td>
                                <td>
                                    <h:inputText label="Credit card number" id="ccNo"  value="2" size="30" required="true">
                                    </h:inputText>
                                    <h:message for="ccNo" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <h:selectOneMenu id="ccType" value="2">
                                        <f:selectItem id="visa" itemLabel="VISA" itemValue="visa" />
                                        <f:selectItem id="mastercard" itemLabel="MasterCard" itemValue="mastercard" />
                                    </h:selectOneMenu>
                                    <h:message for="ccType" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <h:commandButton value="Pay" action="#{confirmControllerBean.confirmed(pickRoomControllerBean.room.roomNb)}" />
                                </td>
                            </tr>
                        </table>
                    </h:form>
                </p:panel>
            </p>


        </ui:define>

    </ui:composition>
</html>

